package threaduse;
import java.util.*;
public class thrd02 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        Thread thread = new Thread(dog);
        thread.start();//静态代理模式
    }
}
class Dog implements Runnable{
    int count=0;
    @Override
    public void run() {
        while(true){
            System.out.println("狗叫"+(++count));
            try{
                Thread.sleep(1000);
            }catch(InterruptedException e){
                e.printStackTrace();
            }
            if(count==10){break;}
        }
    }
}
